package com.easyj.base.storage.service;

import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.multipart.MultipartFile;

import com.easyj.base.common.storage.FileInfo;
import com.easyj.base.exception.FileStoreException;

/**
 * 普通文件上传 service
 * @author hjf
 *
 */
public interface StorageService {
	/**
	 * 保存用户头像文件
	 * @param file
	 * @param request
	 * @return
	 * @throws FileStoreException 
	 */
	public  FileInfo storeAvatarFile(MultipartFile file) throws FileStoreException;
	
	/**
	 * 保存图像文件
	 * @param file
	 * @return
	 * @throws FileStoreException
	 */
	public FileInfo storeImageFile(MultipartFile file) throws FileStoreException;
	/**
	 * 保存附件，保存在 root下的append目录
	 * @param file
	 * @param request
	 * @return
	 * @throws FileStoreException 
	 */
	public  FileInfo storeAppendFile(MultipartFile file) throws FileStoreException;
	
	public boolean deleteFile(String path);
	
	/**
	 * 保存excel 导入结果
	 * @param wb
	 * @param fileType (xls or xlsx) 
	 * @return
	 * @throws FileStoreException
	 */
	public String saveExcelImpResult(Workbook wb,String fileType) throws FileStoreException;

}
